﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Shared/ContentMaster.master"
    CodeFile="clsList.aspx.cs" Inherits="ltMan_news_clsList" EnableEventValidation="false" %>

<asp:Content ID="C1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="C2" ContentPlaceHolderID="CPH1" runat="Server">
    <telerik:RadCodeBlock runat="server">
        <script>
            var win1;
            function goAdd() {
                openCWin('添加类别');
            }
            function openCWin(title, parm) {
                win1 = radopen('clsAdd.aspx?id=' + parm);
                win1.setSize(370, 260);
                win1.set_title(title);
            }
            function reloadData() {
                if (win1)
                    win1.close();
                $find($('.icon-refresh').parent().attr('id')).click();
            }
            function deleteConfirm(s, e) {
                var callBackFunction = Function.createDelegate(s, function (argument) {
                    if (argument) {
                        this.click();
                    }
                });
                radconfirm("确定要删除" + s.get_toolTip() + "(同时删除此类别下信息)？", callBackFunction, 250, 50, null, "删除确认");
                e.set_cancel(true);
            }
            Sys.Application.add_load(function () {
                $('.grid-inline-edit').click(function () {
                    openCWin('修改类别', $(this).attr('eid'));
                });
                $('.rtlL input').css('visibility', 'hidden');
            });
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeList1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadTreeList ID="RadTreeList1" runat="server" DataKeyNames="class_id" ParentDataKeyNames="father_id"
        AutoGenerateColumns="false" OnItemCommand="RadTreeList1_ItemCommand" Width="95%">
        <ClientSettings>
            <Selecting AllowItemSelection="True" />
        </ClientSettings>
        <Columns>
            <telerik:TreeListTemplateColumn>
                <HeaderTemplate>
                    <telerik:RadButton ID="cAdd" runat="server" Icon-PrimaryIconCssClass="icon-add" Text="添加"
                        UseSubmitBehavior="false" ToolTip="添加" OnClientClicking="goAdd" Visible='<%# CurrentUserGroup.HasAdd %>' />
                        <telerik:RadButton ID="cRef" runat="server" CommandName="RebindGrid"
        Icon-PrimaryIconCssClass="icon-refresh" Text="刷新" UseSubmitBehavior="false" ToolTip="刷新" />                        
                    <%--<span style="padding-left:20px;">类别名称</span>--%>
                </HeaderTemplate>
                <ItemTemplate>
                    <nobr><%#Eval("classname") %></nobr>
                </ItemTemplate>
            </telerik:TreeListTemplateColumn>
            <telerik:TreeListTemplateColumn HeaderStyle-Width="60" HeaderStyle-HorizontalAlign="Center"
                ItemStyle-HorizontalAlign="Center" HeaderText="操作">
                <ItemTemplate>
                    <asp:LinkButton ID="lEdit" CssClass="icon icon-edit grid-inline-edit" Style="padding-right: 2px;"
                        runat="server" ToolTip="编辑" eid='<%# Eval("class_id") %>' />
                    <telerik:RadButton ButtonType="ToggleButton" style="position:static;border:0 none;cursor:pointer;" ID="lDel" CssClass="icon icon-delete"
                        runat="server" CommandName="Delete" CommandArgument='<%# Eval("class_id") %>'
                        OnClientClicking="deleteConfirm" ToolTip='<%# Eval("classname") %>' Visible='<%# CurrentUserGroup.HasDel %>' />
                </ItemTemplate>
            </telerik:TreeListTemplateColumn>
        </Columns>
    </telerik:RadTreeList>
</asp:Content>